// UEService.h

#ifndef UE_SERVICE_H
#define UE_SERVICE_H

class CUEService 
{
public:
	CUEService();
	~CUEService();

public:
	/* Stop the running UE service. This function will conect to a 
	 * running UE service and send the stop service request.
	 * @return 0 indicate success, otherwise some error occur.
	 */
	static int StopService();

public:
	/* Start providing UE service. This function will create socket and
	 * put it into listen stat to wait for client connect in.
	 * @param[in] strBaseDir The base dir of UEServer.
	 * @return 0 indicate success, otherwise some error occur.
	 */
	int Start(_TCHAR *strBaseDir);

	/* Stop providing UE service. This function will close the listen 
	 * socket to force end the main loop of UE service.
	 */
	void Stop();

public:
	unsigned short     m_nListenPort;                           // service listen port
	unsigned long      m_nListenAddr;                           // service listen address

	_TCHAR*            m_strBaseDir;                            // base dir

private:
	int                m_ListenSocket;                          // listen socket file descriptor
};

#endif // UE_SERVICE_H
